Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport PR #16671 to 8.16: PipelineBusV2 deadlock proofing #16680

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

github-actions[bot]
Copy link
Contributor

Backport PR #16671 to 8.16 branch, original message:


Release notes

  • Fixes an issue where Logstash shutdown could stall in some cases when using pipeline-to-pipeline.

What does this PR do?

  • Adds tests to detect deadlock betweeen PipelineBus#unlisten and PipelineBus#unregisterSender
  • Eliminates a deadlock that can occur in PipelineBusV2

Why is it important/What is the impact to the user?

Failing to shut down is not good.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] I have made corresponding change to the default configuration files (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works

How to test this PR locally

Related issues

* pipeline bus: add deadlock test for unlisten/unregisterSender

* pipeline bus: eliminate deadlock

Moves the sync-to-notify out of the `AddressStateMapping#mutate`'s effective
synchronous block to eliminate a race condition where unlistening to an address
and unregistering a sender could deadlock.

It is safe to notify an AddressState's attached input without exclusive access
to the AddressState, because notifying an input that has since been disconnected
is net zero harm.

(cherry picked from commit 8af6343)
Copy link

@elasticmachine
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Copy link
Member

@yaauie yaauie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean & green backport

@yaauie yaauie merged commit 913d705 into 8.16 Nov 18, 2024
5 checks passed
@donoghuc donoghuc deleted the backport_16671_8.16 branch November 21, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants